package com.wang.learn.cloudrabbitmq.controller;

import com.wang.learn.cloudrabbitmq.component.CancelOrderSender;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName TestController
 *
 * @author wang
 * Date 2022/2/22 14:01
 */
@RestController
public class TestController {

    final CancelOrderSender cancelOrderSender;

    public TestController(CancelOrderSender cancelOrderSender) {
        this.cancelOrderSender = cancelOrderSender;
    }

    @RequestMapping("test")
    public Object test(Long orderId, String routingKey){
//        cancelOrderSender.sendMessage(orderId, System.currentTimeMillis());
        cancelOrderSender.test(orderId, routingKey);
        return "success";
    }


}
